(function(app) {
	'use strict';

	app.generate = function(username, password, site, version, type) {
		let result = name(`${username},${password},${site},${version}`);
		return result.join('');
	}

	function isLetter(charCode) {
		return charCode >= 97 && charCode <= 122;
	}

	function name(str) {
		let hash = md5(str);
		let result = [];
		for (let i = 0; i < hash.length; i++) {
			if (isLetter(hash.charCodeAt(i))) {
				result.push(hash.charAt(i));
			}
		}
		if (result.length < 8) {
			result.concat(name(hash));
		}
		return result.slice(0, 8);
	}
})(this);